<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>导航栏</title>
    <link rel="stylesheet" href="../../css/qt/Merry-go-round.css" charset="utf-8"/>
    <link rel="stylesheet" href="../../css/qt/nav.css">
    <link rel="stylesheet" href="../../css/qt/head.css">
    <script src="../../JS/jquery-1.12.4.js"></script>
    <style>
        * {
            padding: 0;
            margin: 0;
            list-style: none;
        }
    </style>
</head>
<body>
<!-- 顶部导航starting -->
<div class="nav_top">
    <i class="nav1">欢迎来到 沐歌丨丶 的博客~</i>
    <div class="nav2">
        <i class="c1">沐歌丨丶</i>
        <i class="c2">的专属博客~</i>
    </div>
</div>
<script>
    $(function () {
        $(".nav_top .nav1").fadeIn(3000).fadeOut(3000)
    })
</script>
<script>
    setTimeout(function () {
        $(".nav2").fadeIn(3000)
    },6000)
</script>
<!-- 顶部导航ending -->
<!-- nav starting -->
<div class="nav">
    <div class="nav_mid">
        <?php
        error_reporting(0);
        mysql_connect("localhost","root","1161105403");
        mysql_select_db("blog");
        mysql_query("set names utf8");
        $sql="select * from blogtype";
        $rs=mysql_query($sql)or die('查询1失败！'.mysql_error());
        ?>
        <ul >
            <li style="font-weight: bolder"><a href="../../../blog_php/qt/qt_index.php">首页</a></li>
            <?php
            while($row=mysql_fetch_assoc($rs))
            {
                ?>
                <li><a href="../../../blog_php/qt/list.php?tid=<?php
                    echo $row["tid"];
                    ?>
                "><?php
                        echo $row["typename"];
                        ?>
                    </a></li>
                <?php
            }
            ?>
        </ul>
        </li>
        </ul>
        <form  action="search.php"class="navbar-form navbar-left" role="search" >
            <div class="form-group">
                <input type="text" class="form-control"  name="title" placeholder="Search...">
                <button type="submit" class="btn" >搜索</button>
            </div>

        </form>
    </div>
</div>
<!--  固定导航栏stating-->
<script>
    $(window).scroll(function () {
        if ($(window).scrollTop()>=$(".nav_top").height()){
            $(".nav").addClass("fixed");
            $(".main").css("marginTop",$(".nav").height()-21);
        }else {
            $(".nav").removeClass("fixed");
            $(".main").css("marginTop",0);
        }
    })
</script>
<!--固定导航栏ending-->
<div class="nav_bottom">
    <strong>欢迎来访~</strong>
    <ul>
        <?php
        session_start();
        if(!isset($_SESSION["user"])){
            ?>
            <li><a href="../qt/qt_login/qt_Login.php" >注册</a></li>
            <li><a href="../qt/qt_login/qt_Login.php" >登录</a></li>
            <?php
        }else{
            ?>
            <li><a href="#" >我的评价</a></li>
            <li><a href="../qt/Common/loginOut.php">注销</a></li>
            <li><a href="#">欢迎 <-- <?php echo $_SESSION["user"];?> --></a></li>
            <?php
        }
        ?>
    </ul>


</div>
<!-- nav ending -->


</body>

</html>